package ldh.im.fxbase.rpc.service;

import ldh.im.dto.base.OkResp;
import ldh.im.dto.business.user.LoginResp;
import ldh.im.dto.business.webrtc.*;
import ldh.im.dto.business.webrtc.mesh.WebRtcP2pCandidateReq;
import ldh.im.dto.business.webrtc.mesh.WebRtcP2pSdpReq;
import ldh.rpc.Rpc;
import ldh.rpc.RpcMapper;
import ldh.rpc.exception.RpcException;

/**
 * WebRtc 信令接口
 */
@Rpc
public interface RpcSignalService {

    /**
     * 信令 登录
     * @param webRtcLoginReq
     * @return
     * @throws RpcException
     */
    @RpcMapper(path = "signalLogin")
    LoginResp login(WebRtcLoginReq webRtcLoginReq) throws RpcException;

    /**
     * 建聊天房
     * @param webRtcCreateRoomReq
     * @return
     * @throws RpcException
     */
    @RpcMapper(path = "roomCreate")
    OkResp roomCreate(WebRtcCreateRoomReq webRtcCreateRoomReq) throws RpcException;

    /**
     * 退出聊天房
     * @param webRtcExitRoomReq
     * @return
     * @throws RpcException
     */
    @RpcMapper(path = "roomExit")
    OkResp roomExit(WebRtcExitRoomReq webRtcExitRoomReq) throws RpcException;

    /**
     * 邀请人进房
     * @param webRtcJoinRoomReq
     * @return
     * @throws RpcException
     */
    @RpcMapper(path = "roomJoin")
    WebRtcRoomInfo roomJoin(WebRtcJoinRoomReq webRtcJoinRoomReq) throws RpcException;

    /**
     * 发送sdp
     * @param webRtcP2pSdpReq
     * @return
     * @throws RpcException
     */
    @RpcMapper(path = "sdp")
    OkResp sdp(WebRtcP2pSdpReq webRtcP2pSdpReq) throws RpcException;

    /**
     * 发送iceCandidate
     * @param webRtcP2pCandidateReq
     * @return
     * @throws RpcException
     */
    @RpcMapper(path = "iceCandidate")
    OkResp iceCandidate(WebRtcP2pCandidateReq webRtcP2pCandidateReq) throws RpcException;

    /**
     * 获取房间信息
     * @param webRtcRoomReq
     * @return
     * @throws RpcException
     */
    @RpcMapper(path = "roomInfo")
    WebRtcRoomInfo roomInfo(WebRtcRoomReq webRtcRoomReq) throws RpcException;
}
